package com.dc.project_kotlin.weight.banner

import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
import com.dc.project_kotlin.R
import com.dc.project_kotlin.bean.BannerResponse
import com.zhpan.bannerview.BaseViewHolder

class HomeBannerViewHolder(val view: View): BaseViewHolder<BannerResponse>(view) {

    override fun bindData(data: BannerResponse?, position: Int, pageSize: Int) {
        val img = itemView.findViewById<ImageView>(R.id.bannerhome_img)
        data?.let {
            Glide.with(view.context).load(it.imagePath).transition(DrawableTransitionOptions.withCrossFade(500)).into(img)
        }
    }
}